#ifndef FILESERVER_H
#define FILESERVER_H

#include "singleton.h"

#include <string>
#include <map>
#include <list>

namespace sde {

    typedef std::map<std::string, std::string> StringMap;
    typedef std::list<std::string> StringList;
    typedef std::map<std::string, StringList> StringListMap;
    
    class FileServer : public Singleton<FileServer> {
    private:
        StringListMap filesByType;
        StringMap filesByName;
        
        StringList enumerateFiles(std::string path);
        std::string getType(std::string file);
        std::string getName(std::string file);
        
    public:
        StringList fileTypes;
        StringList modules;
        StringList folders;
    
        FileServer();
        
        bool hasFileType(std::string ext);
        StringList getFilesByType(std::string ext);
        
        bool hasFileName(std::string name);
        std::string getFileByName(std::string name);
        
        void loadModules(int argc, char** argv);
        void loadSimFiles();
    };
}

#endif
